package ch.mueller.android.sensorexample.sensorpages.gpssensor.util.readerFactoryElements;

import java.util.LinkedHashMap;

public class VTCAnalyser extends GPSLineAnalyser {

 
    public VTCAnalyser(String line) {
        super(line);
    }

    @Override
    public LinkedHashMap<String, String> getResult() {
        LinkedHashMap<String, String> element = new LinkedHashMap<String, String>();
        int i = 0;
        String[] splitts = line.split(",");
        element.put("TYPE", getValue(splitts, i++));
        element.put("Course1", getValue(splitts, i++));
        element.put("Reference1", getValue(splitts, i++));
        element.put("Course2", getValue(splitts, i++));
        element.put("Reference2", getValue(splitts, i++));
        element.put("Speed1", getValue(splitts, i++));
        element.put("Units1", getValue(splitts, i++));
        element.put("Speed1", getValue(splitts, i++));
        element.put("Units2", getValue(splitts, i++));
        element.put(CHECKSUM, calculateCheksum(line));
        return element;
    }
}
